#include <stdio.h>
#include <string.h>

const int N = 129;

int main()
{
    int flag = 0;
    char a[N], b[N];
    if (gets(b) != NULL)
    {
        while (gets(a) != NULL)
        {
            if (strcmp(a, b) != 0)
            {
                flag = 0;
                strcpy(b, a);
            }
            else if (!flag)
            {
                flag = 1;
                puts(a);
            }
        }
    }
    return 0;
}